//
//  BaseModel.m
//  CatMusic
//
//  Created by dllo on 15/4/21.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "BaseModel.h"

@implementation BaseModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    
}
- (void)setValue:(id)value forKey:(NSString *)key
{
    if ([key isEqualToString:@"singer_pic_url"]) {
        if (value == NULL) {
            self.pic_url = nil;
            NSLog(@"%@",self.pic_url);
        }
    }
}
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self.singer_name forKey:@"singer_name"];
    [aCoder encodeObject:self.song_name forKey:@"song_name"];
    [aCoder encodeObject:self.songe_url forKey:@"songe_url"];
    [aCoder encodeObject:self.lyric_url forKey:@"lyric_url"];
    [aCoder encodeObject:self.song_time forKey:@"song_time"];
    [aCoder encodeObject:self.pic_url forKey:@"pic_url"];
    
}
- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    if (self) {
        self.pic_url = [aDecoder decodeObjectForKey:@"pic_url"];
        self.song_name = [aDecoder decodeObjectForKey:@"song_name"];
        self.songe_url = [aDecoder decodeObjectForKey:@"songe_url"];
        self.singer_name = [aDecoder decodeObjectForKey:@"singer_name"];
        self.lyric_url = [aDecoder decodeObjectForKey:@"lyric_url"];
        self.song_time = [aDecoder decodeObjectForKey:@"song_time"];
        
    }
    return self;
}



@end
